﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Security;

namespace carportal.Account
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
        }

        protected void LoginUser_LoggedIn(object sender, EventArgs e)
        {
            SqlDataSource1.SelectParameters["membership_uniqid"].DefaultValue =
                Membership.GetUser(LoginUser.UserName).ProviderUserKey.ToString().ToUpper(); ;
            DataView dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
            Session["UserID"] = dv.Table.Rows[0]["user_id"].ToString();
            Response.Redirect("../offer_cars.aspx");
        }
    }
}
